<template>
  <div
    class="jy-style-height message-box"
    :style="{
      backgroundImage: `url(${publicUrls + 'free/style10/publicStyle10Bg.png' + '?imageView2/3/format/webp'})`,
    }"
  >
    <div class="cultural-bg">
      <div class="copyright-heard">
        <div class="backHome" @click="blankHome">
          <i class="freeIcon">&#xe642;</i>
        </div>

        <div
          class="heard-title"
          :style="{
            backgroundImage: `url(${
              publicUrls + 'free/style10/publicStyle10titleBg.png' + '?imageView2/3/format/webp'
            })`,
          }"
        >
          留言板
        </div>
        <div class="backHome"></div>
      </div>
      <div class="comment-box">
        <comment text="发表评论" />
      </div>
      <div class="commentList-box">
        <div class="commentNum" v-if="total !== 0">共{{ total }}条留言</div>
        <div class="commentList-box-content">
          <ScrollBox
            color="rgba(50, 43, 37, 1)"
            :tabbmScroll="getTabmComputed"
            :byid="4235"
            :height="getScrollWComputed"
          >
            <template #solidBorderCon>
              <commentList
                @emitTotal="emitTotal"
                textColor="#56677B"
                bgColor="rgba(241, 239, 234, 0.50)"
                replyColor="#56677B"
              />
            </template>
            <template #solidBorderEx>
              <div class="solidBorder-child"></div>
            </template>
          </ScrollBox>
        </div>
      </div>
    </div>
    <MenuNavigation />
    <div class="content-door">
      <i class="iconfonts">&#xe6dd;</i>
      <span>永不落幕的展览与展示平台</span>
    </div>
  </div>
</template>

<script lang="ts">
// @ts-nocheck
export default defineComponent({
  name: 'style7',
});
</script>

<script setup lang="ts">
// @ts-nocheck
import { defineComponent, ref, computed, onMounted, nextTick } from 'vue';
import comment from '../messageComponent/style10/comment.vue';
import commentList from '../messageComponent/style10/commentList.vue';
import { publicUrls, doorUrl } from '@/utils/minxin';
import { commonDataStore, useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
// import ScrollBox from '../scrollBox.vue';
import ScrollBox from '..//scrollBox10.vue';
import MenuNavigation from '@/freeComponents/menuNavigation/index.vue';

const router = useRouter();
const route = useRoute();
const store = useProjectStore();
const total = ref(0);
const scrollheight = ref();
const commonStore = commonDataStore();
let viewportHeight = window.innerHeight;
scrollheight.value = viewportHeight * 0.33;
const blankHome = () => {
  // console.log('厨房大')
  //   store.menuId = null;
  router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
};
const emitTotal = (num: number) => {
  total.value = num;
};
const getScrollWComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 338;
  return heights;
});
const getTabmComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 98;
  return heights;
});

const initSetting = () => {
  const isMobile = navigator.userAgent.match(
    /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i,
  );
  nextTick(() => {
    commonStore.menuList.forEach((item) => {
      if (!item.config) {
        switch (item.type) {
          case 2:
            router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
            break;
        }
      }
    });
    if (isMobile) {
      router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
    }
  });
};
onMounted(() => {
  setTimeout(() => {
    commonStore.getMenuList();
    initSetting();
  }, 500);
});
</script>

<style scoped lang="less">
.message-box {
  width: 100%;
  padding-bottom: 0px;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}
.logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  position: absolute;
  bottom: 0px;
  left: 0px;
  .iconfonts {
    font-size: 25px;
    line-height: 32px;
    color: rgba(156, 180, 158, 1);
    margin-top: 3px;
  }
  span {
    font-family: PingFang SC;
    font-size: 16px;
    line-height: 22.4px;
    text-align: left;
    color: rgba(156, 180, 158, 1);
    margin-left: 8px;
  }
}
.cultural-bg {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 118px 80px;
  padding-bottom: 0px;
}
.copyright-heard {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 40px;

  .backHome {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 48px;
    height: 48px;
    margin-left: 0 !important;
    .freeIcon {
      font-size: 34px;
      line-height: 34px;
      color: rgba(57, 56, 54, 1);
    }
  }
  .heard-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 258px;
    height: 68px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    font-family: SJxingkai-C;
    font-size: 40px;
    font-weight: 400;
    line-height: 60px;
    color: rgba(57, 56, 54, 1);
  }
}
.comment-box {
  width: 100%;

  margin-bottom: 38px;
}

.commentList-box {
  display: flex;
  flex-direction: column;
  //   flex: 1;
  height: 338px;
  width: 100%;
}

.commentNum {
  width: 100%;
  height: 24px;
  font-family: PingFang SC;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: left;
  color: rgba(57, 56, 54, 0.8);
}
.commentList-box-content {
  width: 100%;
  height: 100%;
  // overflow: auto;
}
::v-deep .t-textarea__inner {
  border: none;
}
:deep(.t-avatar) {
  width: 64px !important;
  height: 64px !important;
}
.solidBorder-child {
  width: 4px;
  height: 100%;
  background: rgba(133, 134, 139, 0.3);
  border-radius: 25px;
}
:deep(.solid-box-parent) {
  position: absolute;
  right: -0px;
}
:deep(.unit-exbi-remarks-info-remarks) {
  width: calc(100% - 32px);
}
::v-deep .templatestyle1-scroll-box-tumb {
  display: flex;
  justify-content: center;
  top: -4px;
  .scrollBar {
    width: 4px;
    // height: 100%;
    height: 98px;
    background: linear-gradient(0deg, #5b5b5b 1.93%, #7e7e7e 100%);

    border-radius: 25px;
    box-shadow: none;
  }
}
:deep(.tumb-max) {
  top: calc(336px - 98px) !important;
}
.content-door {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  bottom: 0;
  .iconfonts {
    font-size: 26px;
    color: #85868b;
    margin-bottom: 4px;
    line-height: 32px;
  }
  span {
    font-family: PingFang SC;
    font-size: 16px;
    line-height: 32px;
    color: #85868b;
    margin-left: 20px;
    padding-bottom: 7px;
  }
}
</style>